import $H from '../lib/request.js';
const app = getApp()
const manApi  = app.globalData.baseUrl



const getList='/api/applet/banner/getList';
const bindList='/api/applet/product/getList';
const unbindCode='/api/applet/code/unbindCode';
const getCode='/api/applet/code/getCode';
const activate='/api/applet/code/activate/';
const info='/api/applet/config/info';

/**
 * 
 * @param {*} params 
 */
export function dataList(params) {
  return $H.get(manApi, `${getList}`,params);
}

/**
 * 
 * @param {*} params 
 */
export function productList(params) {
  return $H.get(manApi, `${bindList}`,params);
}

/**
 * 
 * @param {*} params 
 */
export function untieCode(params) {
  return $H.post(manApi, `${unbindCode}/${params}`);
}

/**
 * 
 * @param {*} params 
 */
export function inquireCode(params) {
  return $H.get(manApi, `${getCode}`,params);
}

/**
 * 
 * @param {*} params 
 */
export function activationCode(params) {
  return $H.post(manApi, `${activate}${params.code}`,params);
}

/**
 * 
 * @param {*} params 
 */
export function getProductInfo(params) {
  return $H.get(manApi, `${info}`,params);
}